<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<title>BOM PreAdd</title>
        <#include "../../inc/css.ftl">
		<link rel="stylesheet" href="${request.contextPath}/static/asset/jquery-ui/1.11.2/jquery-ui.min.css">
		<link rel="stylesheet" href="${request.contextPath}/static/asset/jquery-ui/1.11.2/jquery-ui.theme.min.css">
		<link rel="stylesheet" href="${request.contextPath}/static/asset/jquery/jquery.autocomplete/jquery.autocomplete.css">
	</head>
	<body class="no-skin">
		<div class="container-fluid">
			<div class="row">
			  <div class="breadcrumbs">
				<ul class="breadcrumb">
					<li><i class="ace-icon fa fa-home home-icon"></i><a href="${request.contextPath}/index.jspx" target="_top">首页</a></li>
					<li><a href="">仓库</a></li>
					<li><a href="list.jspx">物料BOM信息</a></li>
					<li class="active">新增或修改</li>
				</ul>
				  <!-- /.breadcrumb -->
			  </div>
			  <!-- /.breadcrumbs -->
			</div>
			<!-- /.row -->
			<div class="row">
				<div class="page-content">
					<div class="page-header">
						<h1>物料BOM信息新增或修改</h1>  
					</div>
					<div class="row">
						<div class="col-xd-12">
						    <form action="add.jspx" method="post" class="form-horizontal" role="form" id="form-data">
						    	<div class="form-group">
						    		<label class="col-sm-2 control-label no-padding-right"> 编号  </label>
									<div class="col-sm-4">
										<input type="text" id="code" name="code" placeholder="编号" class="form-control" />
										<span style="color:#ccc">(修改某主物料的BOM信息，直接输入编号)</span>
										<input type="hidden" id="old_code" value="0">
									</div>
									
									<label class="col-sm-2 control-label no-padding-right"> 规格  </label>
									<div class="col-sm-4">
										<input type="text" id="name" name="name" placeholder="规格" class="col-sm-12" />
									</div>
								</div>
								<div class="space-4"></div>
								<div class="form-group">
									<div>
										<a href="javascript:void(0)" id="add_detail" class="btn btn-primary">增加物料信息</a>
									<div>
									<div>
										<table class="table">
											<thead>
												<tr>
													<td>操作</td>
													<td>序号</td>
													<td>物料代码</td>
													<td>物料名称</td>
													<td>规格型号</td>
													<td>描述</td>
													<td>数量</td>
													<td>关键<br/>特性</td>
													<td>导体结构</td>
													<td>绝缘<br/>厚度<br/>(mm)</td>
													<td>线芯外径<br/>(mm)</td>
													<td>单位</td>
													<td>存储<br/>类型</td>
													<td style="display:none">箱号</td>
												</tr>
											</thead>
											<tbody id="detail_container"></tbody>
										</table>
										<script type="text/html" id="bom_detail">
												<tr id="detail_{{index}}">
													<td><span class="ace-icon fa fa-remove" title="删除此信息" style="cursor:pointer; color:red" onclick="repo.Bom.Edit.delDetail('detail_{{index}}')"></span></td>
													<td>{{index}}
														<input type="hidden" id="id_{{index}}" name="id_{{index}}" value="{{id}}">
													</td>
													<td data-no="{{index}}"><input type="text" name="materialCode_{{index}}" class="autocomplete" size="10" value="{{materialCode}}"></td>
													<td><input type="text" id="materialName_{{index}}" name="materialName_{{index}}" size="10" value="{{materialName}}"></td>
													<td><input type="text" id="materialModel_{{index}}" name="materialModel_{{index}}" size="15" value="{{materialModel}}"></td>
													<td><input type="text" id="materialDesc_{{index}}" name="materialDesc_{{index}}" size="6" value="{{materialDesc}}"></td>
													<td><input type="text" name="needNum_{{index}}" size="4" value="{{needNum}}"></td>
													<td><input type="text" name="spec_{{index}}" size="2" value="{{spec}}"></td>
													<td><input type="text" name="structure_{{index}}" size="12" value="{{structure}}"></td>
													<td><input type="text" name="thickness_{{index}}" size="4" value="{{thickness}}"></td>
													<td><input type="text" name="outerDiameter_{{index}}" size="4" value="{{outerDiameter}}"></td>
													<td><input type="text" id="unit_{{index}}" name="unit_{{index}}" size="4" value={{unit}}></td>
													<td><input type="text" name="storeType_{{index}}" size="2" value="{{storeType}}"></td>
													<td style="display:none"><input type="text" name="boxNum_{{index}}" size="3" value="{{boxNum}}"></td>
												</tr>
										</script>
										<input type="hidden" name="current_index" id="current_index" value="0">
									</div>
								</div>
								
								<div class="clearfix form-actions">
									<div class="col-sm-offset-2 col-sm-4">
										<button type="reset" class="btn">
											<i class="ace-icon fa fa-undo bigger-110"></i>
											重置
										</button>
										&nbsp;&nbsp;
										<button id="plan-submit" type="submit" class="btn btn-info">
											<i class="ace-icon fa fa-check bigger-110"></i>
											提交
										</button>
									</div>
								</div>
						    </form>
					    </div>
					</div>
					<!-- /.row -->
				</div>
				<!-- /.page-content -->
			</div>
		</div>
		<#include "../../inc/js.ftl">
		<script src="${request.contextPath}/static/asset/jquery-ui/1.11.2/jquery-ui.min.js"></script>
		<script src="${request.contextPath}/static/asset/jquery/jquery.autocomplete/jquery.autocomplete.min.js"></script>
		<script src="${request.contextPath}/static/asset/jquery/template.js"></script>
		<script src="${request.contextPath}/static/skin/default/js/repo-list.js"></script>
		<script>
			$(document).ready(function(){
				repo.Bom.Edit.init({ctx:"${request.contextPath}"});
				root.Validator.Bom.validate();
			});
		</script>
	</body>
</html>